public class Display {
    private int value;
    private int limit;
    private Display hour;
 
    public Display(int limit, Display hour) {
        this.limit = limit;
        this.hour = hour;
    }
 
    public void increase() {
        value++;
        if (value == limit) {
            value = 0;
            if (hour != null) this.hour.increase();
        }
    }
 
    public int getValue() {
        return value;
    }
 

}
